package com.ysd.lis.controller.emr;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.emr.EmrProcess;
import com.ysd.lis.service.emr.EmrProcessService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wh
 * @since 2025-06-07
 */
@RestController
@RequestMapping("/emr/task")
public class EmrProcessController extends BaseController {
    @Autowired
    private EmrProcessService emrProcessService;


    @ApiOperation("查询")
    @GetMapping("/findEmrTaskList")
    public Result findEmrTaskList(String keyvalue) {
        return emrProcessService.findEmrTaskList(keyvalue);
    }

    @ApiOperation("查询流程根据用户")
    @GetMapping("/findEmrTaskListByUser")
    public Result findEmrTaskListByUser(String keyvalue) {
        return emrProcessService.findEmrTaskListByUser(keyvalue);
    }


    @ApiOperation("保存")
    @PostMapping("/addEmrTask")
    public Result addEmrTask(@RequestBody EmrProcess emrTask) {
        return emrProcessService.addEmrTask(emrTask);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteEmrTask")
    public Result deleteEmrTask(@RequestBody List<EmrProcess> emrTasks) {
        return emrProcessService.deleteEmrTask(emrTasks);
    }


}
